A microcontroller is an integrated circuit chip that can be used in a variety of different applications that include, for example, automobiles, medical devices, telephones, remote controls, and appliances. Microcontrollers have, among other things, logic circuits and I/O pins. The logic circuits may include specialized circuit modules that provide, for example, analog-to-digital conversion and/or logical interfacing (e.g., USART (universal synchronous/asynchronous receiver transmitter), TWI (two wire interface), and SPI (serial peripheral interface). The I/O pins connect logic circuits on the microcontroller to external devices and may be input only, output only, or bidirectional (i.e., both input and output). However, because the number of logic circuit inputs and outputs that can be connected to the I/O pins is usually greater than the number of I/O pins, and because different microcontroller applications may require connection to some logic circuits and not others, microcontrollers may have I/O pins that are software configurable. That is, users have some flexibility in selecting the logic circuit inputs and outputs to be connected to the I/O pins.
However, this flexibility is very limited in known microcontrollers because of fixed, predefined hardwired multiplexing between the microcontroller's logic circuits and I/O pins. For example, a microcontroller I/O pin may only be configurable with one of three possible functions. As shown in FIG. 1, PIN 1 is connected to multiplexer 102, which is hardwired to receive only FUNCTION 1, FUNCTION 2, and FUNCTION 3 from the microcontroller's logic circuits. Multiplexer 102 is controlled by software 104, which is programmable by a user. The user is limited to configuring microcontroller I/O PIN 1 to output only one of the three functions. Furthermore, FUNCTION 1, FUNCTION 2, and FUNCTION 3 may not be available at any other I/O pin. Thus, if more than one of those functions is desired in a user application, the user has to determine whether or not that application can do without any of the desired functions, and if not, the user may have to consider using another microcontroller.
FIG. 2 shows a more detailed example of a limited pinout configuration in a microcontroller. Microcontroller 200 includes circuit modules for a USART 204, a TWI 206, an SPI 208, and a timer 210. These modules each have outputs hardwired to one or more predefined multiplexers 202, which are connected to respective I/O pins of the microcontroller. Also hardwired to multiplexers 202 are outputs from high speed logic circuit 212 (which may perform, for example, DDR (double data rate) or Ethernet signaling functions). Because of the hardwired multiplexing, PIN 1, for example, can only be used to output either a USART.TX transmit signal, a TWI.SDA (two wire interface) serial data line, an SPI.CK (serial peripheral interface) clock, or a high speed or timing constrained signal from circuit 212. No other signals can be output from PIN 1 and three of those four signals can only be output at PIN 1.
FIGS. 3 and 4 illustrate the difficulties encountered early in the application development process by users of microcontrollers having limited pinout configurations. FIG. 3 represents a microcontroller 300 having four modules (“Mx”, with x=1, 2, 3, or 4), each having three input/output signal nodes (“Ny”, with y=1, 2, or 3). As shown, only three nodes representing functions A, B, and C, respectively, are available for mapping (i.e., connection) to any one I/O pin. That is, PIN 1 can only be configured to connect to node 1 of module 1 (M1_N1), node 1 of module 2 (M2_N1), or node 1 of module 3 (M3_N1). PIN 2 can only be configured to connect to node 1 of module 4 or node 2 of module 1 or 2. PIN 3 can only be configured to connect to node 2 of module 3 or 4 or node 3 of module 1. And PIN 4 can only be configured to connect to node 3 of module 2, 3, or 4. This limited pinout configuration is fixed at the integrated circuit (IC) design stage of the microcontroller, where IC designers have the difficult task of anticipating in advance all possible uses of the microcontroller in order to optimize the A/B/C allocations on each I/O pin.
Users need to study the available pinout configurations carefully in order to determine which logic circuit nodes to bring out to an I/O pin (and which ones to sacrifice) in accordance with the user's application. This can be done by referencing an I/O multiplexing map document or product datasheet, either manually or via software, wherein a look-up is performed for each pin to find the A/B/C/function allocation. In a worst case scenario, the available pinout configuration will not satisfy a user's requirements. Users of such known microcontrollers, therefore, need to consider such constraints early in the application development process.
FIG. 4 illustrates a process 400 of configuring the I/O pins of microcontroller 300. At step 401, a user identifies PIN 1 as being configurable to connect to only logic circuit node M1_N1, M2_N1, or M3_N1, representing functions A, B, and C, respectively. At step 403, the user programs software 304 to configure PIN 1 with selected function A. Multiplexer logic 302, which is controlled by software 304, connects node 1 of module 1 to PIN 1. Similarly, at step 405, the user identifies PIN 2 as being configurable to connect to only node M4_N1, M1_N2, or M2_N2. At step 407, the user programs software 304 to configure PIN 2 with selected function B, which connects node 2 of module 1 to PIN 2. And again, at step 409, the user identifies PIN 3 as being configurable to connect to only node M3_N2, M4_N2, or M1_N3. At step 411, the user programs software 304 to configure PIN 3 with selected function C. The complexity of this tedious process can increase dramatically as the number of I/O pins increases.
Microcontrollers are typically mounted on an application board which routes the connections from the microcontroller I/O pins to other devices. Another disadvantage of the limited pinout configurations of known microcontrollers is that optimizing the signal routing on an application board (which typically lowers the costs involved) may be very difficult. For example, signal routing on an application board may be optimized for a particular signal if that signal were mapped to PIN 50 because of that pin's location on the microcontroller chip; however, a user may only be able to use PIN 1 for that signal because of the microcontroller's limited pinout configuration, which will likely result in a less than optimized routing.